package com.netease.spring.advice;

import java.lang.reflect.Method;

import org.springframework.aop.MethodBeforeAdvice;

public class WelcomeAdvice implements MethodBeforeAdvice {

	@Override
	public void before(Method method, Object[] args, Object target)
			throws Throwable {
		if(method.getName().equals("buySquishee")) {
			Customer customer = (Customer)args[0];
			System.out.println("Hello " + customer.getName() + "!");
		} else {
			System.out.println("You do the operation [" + method.getName() + "]");
		}
	}

}
